﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MsgList.aspx.cs" Inherits="CampanyCMS.WebUI.Admin.LeaveMsg.MsgList" %>

<%@ Register TagPrefix="cc1" Namespace="COM.ZTE.TPG.App.UI.WebForm" Assembly="COM.ZTE.TPG.App.UI.WebForm" %>
<%@ Register Assembly="My97" Namespace="My97" TagPrefix="cc2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../css/cssCn.css" type="text/css" rel="stylesheet">
    <style type="text/css">
        .style1
        {
            height: 42px;
        }
    </style>
        <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../js/Common.js" type="text/javascript"></script>
    <script type="text/javascript">
        function SelectAll(strGridId) {
            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();

            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }
            for (loop = 1; loop < objArray.length; loop++) {
                if (!objArray[loop].disabled) {
                    objArray[loop].click();
                    objArray[loop].checked = objArray[0].checked;
                }
            }
        }
        function CheckSelected(strGridId, isdel) {
            var taskIds;
            var check = false;
            var objCK = document.getElementsByTagName("input");
            var loop;
            var index = 0;
            var objArray = new Array();
            for (loop = 1; loop < objCK.length; loop++) {
                if (objCK[loop].type == "checkbox") {
                    if (objCK[loop].id.indexOf(strGridId) != -1) {
                        objArray[index] = objCK[loop];
                        index++;
                    }
                }
            }
            for (loop = 1; loop < objArray.length; loop++) {
                if (objArray[loop].checked) {

                    check = true;
                }
            }
            if (!check) {
                alert('请至少选择一个信息进行操作！');
                return false;
            }
            if (isdel == 1) {
                return confirm("确认要删除你所选择的信息吗？");
            }
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <table id="tb_content" cellspacing="0" cellpadding="0" align="center">
        <tbody>
            <tr>
                <td>
                    <table class="tb_searchbar" cellspacing="1" width="100%">
                        <tbody>
                            <tr>
                                <td class="td_head" colspan="5">
                                    请填写查询条件
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title" nowrap width="15%">
                                    消息标题
                                </td>
                                <td class="detail">
                                    <asp:TextBox ID="txtMsgTitle" runat="server" Width="200px"></asp:TextBox>
                                </td>
                                <td class="td_title" nowrap width="15%">
                                    消息时间
                                </td>
                                <td class="td_detail">
                                    <cc2:DateTextBox ID="txtBeginDate" runat="server" ImgPath="../../img/calendar.gif"
                                        Width="120px" OnPickClientID="txtEndDate"></cc2:DateTextBox>
                                    至
                                    <cc2:DateTextBox ID="txtEndDate" runat="server" ImgPath="../../img/calendar.gif"
                                        Width="120px"></cc2:DateTextBox>
                                </td>
                            </tr>
                            <tr>
                            <td class="td_title" nowrap width="15%" style="height: 42px">
                                    消息类型
                                </td>
                                <td class="style1">
                                    <asp:RadioButtonList ID="rbtType" RepeatDirection="Horizontal" runat="server">
                                        <asp:ListItem Text="全部" Value="0" Selected></asp:ListItem>
                                        <asp:ListItem Text="产品留言" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="订单留言" Value="2"></asp:ListItem>
                                        <asp:ListItem Value="3">系统留言</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td class="td_title" nowrap width="15%" style="height: 42px">
                                    状态</td>
                                <td class="style1">
                                    <asp:RadioButtonList ID="rbtHaveNews" RepeatDirection="Horizontal" 
                                        runat="server">
                                        <asp:ListItem Text="全部" Value="-1" Selected></asp:ListItem>
                                        <asp:ListItem Text="已阅" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="未阅" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                              <td align="left"  >
                                    <asp:Button ID="btndelete" runat="server" Text="删除" CssClass="button" 
                                      OnClick="btndelete_Click">
                                    </asp:Button>
                              </td>
                                <td align="right" colspan="3">
                                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="button" OnClick="btnSearch_Click">
                                    </asp:Button>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <cc1:ZteGrid ID="dgMsgs" runat="server" Style="margin-top: 5px" CssClass="tb_datalist"
                        PageChange="TextBox" Width="100%" AllowPaging="True" 
                        PageLanguage="Chinese" IsAllowPaging="True"
                        CellSpacing="1" AutoGenerateColumns="False" CacheData="ServerCach" SortMode="Total"
                        PageCSS="scrollButton" BorderStyle="Solid" ScollWidth="" 
                          onitemdatabound="dgMsgs_ItemDataBound" 
                        onitemcommand="dgMsgs_ItemCommand">
                        <AlternatingItemStyle CssClass="tr_alertrow"></AlternatingItemStyle>
                        <FooterStyle></FooterStyle>
                       <ItemStyle CssClass="tr_datarow" />
                        <Columns>
                  
                               <asp:TemplateColumn>
                                <HeaderStyle Width="30px" />
                                <HeaderTemplate>
                                    <asp:CheckBox ID="cbxAll" runat="server" ToolTip="全选/全否选" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbItem" runat="server" /> <asp:Image ID="imgIsnew" Visible=false  runat="server" />
                                         <input id="txtMsg_ID"  runat=server value='<%# DataBinder.Eval(Container.DataItem, "Msg_ID")%>'   type="hidden" />
 
                        <input id="txtHaveNews"  runat=server value='<%# DataBinder.Eval(Container.DataItem, "HaveNews")%>'   type="hidden" />
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            
                            <asp:BoundColumn DataField="Msg_title" HeaderText="消息标题"></asp:BoundColumn>
                            <asp:BoundColumn DataField="create_by" HeaderText="留言者姓名"></asp:BoundColumn>
                            <asp:BoundColumn DataField="Create_Date" HeaderText="留言时间"></asp:BoundColumn>
                         
                            <asp:TemplateColumn HeaderText="类型">
                                <ItemTemplate>
                                    <asp:Label ID="lbKeyType" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Key_Type")%>'></asp:Label>  
                                </ItemTemplate>
                            </asp:TemplateColumn>
                             <asp:TemplateColumn HeaderText="回复数">
                                <ItemTemplate>
                                     <asp:Label ID="lbCont" runat="server" Text=""></asp:Label> 
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn>
                                <HeaderTemplate>
                                    操作
                                </HeaderTemplate>
                                <ItemTemplate>
                                     
                                    <a href='ViewMsg.aspx?Mainid=<%# DataBinder.Eval(Container.DataItem, "Mainid")%>&KeyValue=<%# DataBinder.Eval(Container.DataItem, "Key_Value")%>&KeyType=<%# DataBinder.Eval(Container.DataItem, "Key_Type")%>'> 查看</a>
                                     
                                </ItemTemplate>
                            </asp:TemplateColumn>
                        </Columns>
                        <HeaderStyle CssClass="tr_title"></HeaderStyle>
                        <SelectedItemStyle CssClass="tr_selected"></SelectedItemStyle>
                        <PagerStyle CssClass="tr_pagenumber"></PagerStyle>
                    </cc1:ZteGrid>
                </td>
            </tr>
        </tbody>
    </table>
    </form>
</body>
</html>
